import rimraf from 'rimraf';

/**
 * rollup插件
 * 每次打包构建时，需要删除上次的打包文件
 */
export default function rollupPluginClean() {
    return {
        name: 'rollup-plugin-clean',
        buildStart: () => {
            rimraf.sync(__dirname + '/dist');
        }
    }
}